/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-10
 * Time: 23:10
 */
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        CourseManagementSystem cms = new CourseManagementSystem();
        String operate;
        int n = sc.nextInt();
        for (int i=1;i<=n;i++) {
            operate = sc.next();
            if (operate.equals("add"))
                cms.add(sc.nextInt(), sc.next(),sc.next(),sc.nextDouble());
            else if  (operate.equals("delete"))
                cms.delete(sc.nextInt());
            else if  (operate.equals("query"))
                cms.query(sc.nextInt());
        }
        cms.statistic();
    }
}
class Student{
    private String name,sex;
    private double score;
    public Student(String name, String sex, double score) {
        this.name = name;
        this.sex = sex;
        this.score = score;
    }
    @Override
    public String toString() {
        return "姓名：" + name + ", 性别：" + sex + ", 成绩：" + score;
    }
    public String getName() {
        return name;
    }
    public String getSex() {
        return sex;
    }
    public double getScore() {
        return score;
    }
}
class CourseManagementSystem{
    private Map<Integer,Student> mp=new HashMap<Integer,Student>();
    /* 请在这里填写答案 */
    public void add(int no,String name,String sex,double score){
        if (mp.containsKey(no)) {
            System.out.println("此学生已存在，无需添加");
        }
        else {
            mp.put(no,new Student(name,sex,score));
        }
    }
    public void delete(int no){
        if (mp.containsKey(no)) {
            mp.remove(no);
        }
        else {
            System.out.println("此学生不存在，无法删除");
        }
    }
    public void query(int no){
        if (mp.containsKey(no)) {
            System.out.println(mp.get(no));
        }
        else {
            System.out.println("所查找学生不存在");
        }
    }
    public void statistic(){
        Set<Integer>keys = mp.keySet();
        Iterator<Integer> iter = keys.iterator();
        int[] arr = new int[10];
        while (iter.hasNext()) {
            int num	= iter.next();
            double s = mp.get(num).getScore();
            if (s>0&&s<=59) {
                arr[0]++;
            }
            else if (s>=60&&s<=69) {
                arr[1]++;
            }
            else if (s>=70&&s<=79) {
                arr[2]++;
            }
            else if (s>=80&&s<=89) {
                arr[3]++;
            }
            else if (s>=90&&s<=100) {
                arr[4]++;
            }
        }
        System.out.println("[0-59] :"+arr[0]+"人");
        System.out.println("[60-69] :"+arr[1]+"人");
        System.out.println("[70-79] :"+arr[2]+"人");
        System.out.println("[80-89] :"+arr[3]+"人");
        System.out.println("[90-100] :"+arr[4]+"人");


    }


}